/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.wors.android.custom.rideshare2;

import android.util.Log;

/**
 *
 * @author 231260
 */
public class Driveway {
	
	public String datum;
	public String smer;
	public String ridic;
	public String[] pasazeri;
	
	public Driveway(String datum, String smer, String ridic)
	{
		this.datum = datum;
		this.smer = smer;
		this.ridic = ridic;
		this.pasazeri = new String[0];
	}

	public String getDatum() {
		return datum;
	}

	public String[] getPasazeri() {
		return pasazeri;
	}

	public void setPasazeri(String[] pasazeri) {
		this.pasazeri = pasazeri;
	}

	public String getRidic() {
		return ridic;
	}

	public String getSmer() {
		return smer;
	}
	
	public void addPasazer(String jmeno)
	{
		String[] puvodni = getPasazeri();
		
		if (RideShare2Activity.DEBUG) {
			Log.i("ADD PASSENGER","Původně pasažérů: "+puvodni.length);
		}
		String[] novi = new String[puvodni.length+1];
		System.arraycopy(puvodni, 0, novi, 0, puvodni.length);
		
		novi[puvodni.length] = jmeno;
		
		this.pasazeri = novi;
	}
}
